package com.tomek.ktoryoperator.utils;

import android.app.Activity;
import android.view.View;

public class ViewUtils {
	public static void toggleView(Activity context, int id, int visibility) {
		View v = context.findViewById(id);

		if (v != null) {

			v.setVisibility(visibility);
		}
	}

	public static void toggleViewGone(Activity context, int id, boolean visible) {
		toggleView(context, id, visible ? View.VISIBLE : View.GONE);
	}

	public static void toggleView(Activity context, int id, boolean visible) {
		toggleView(context, id, visible ? View.VISIBLE : View.INVISIBLE);
	}
}
